<ul data-role="listview" data-inset="true" data-filter="<?php echo $this->dataFilter ? 'true' : 'false'; ?>">
<?php
$data = $this->dataProvider->getData();
$owner = $this->getOwner();
foreach ($data as $i=>$item) {
    echo "<li>";
    $owner->renderPartial($this->itemView, array('data'=>$item, 'otherInfo'=>$this->otherInfo));
    echo "</li>";
}
?>
</ul>
<?php
$pagination = $this->dataProvider->getPagination();
if ($pagination != NULL && $pagination->getPageCount() > 1) {
    $pageNo = $pagination->getCurrentPage() + 1;

    $pages = array();
    for ($i = 0; $i < $pagination->getPageCount(); $i++) {
        $pages[($i + 1)] = Yii::t('site', 'Page {no}', array('{no}'=>($i + 1)));
    }

    $disablePrev = '';
    $prevPageUrl = '';
    if ($pageNo <= 1) {
        $disablePrev = ' disabled="disabled"';
    } else {
        $prevPageUrl = $pagination->createPageUrl($owner, $pageNo - 2);
    }

    $disableNext = '';
    $nextPageUrl = '';
    if ($pageNo >= $pagination->getPageCount()) {
        $disableNext = ' disabled="disabled"';
    } else {
        $nextPageUrl = $pagination->createPageUrl($owner, $pageNo);
    }
?>
<div class="ui-field-contain">
	<fieldset data-role="controlgroup" data-type="horizontal">
        <button onclick="gotoPage('<?php echo $prevPageUrl; ?>')"<?php echo $disablePrev; ?>><?php echo Yii::t('site', 'Prev Page'); ?></button>
        <?php echo CHtml::dropDownList('page', $pageNo, $pages, array('onchange'=>'selectPage($(this).val())')); ?>
        <button onclick="gotoPage('<?php echo $nextPageUrl; ?>')"<?php echo $disableNext; ?>><?php echo Yii::t('site', 'Next Page'); ?></button>
	</fieldset>
</div>
<script>
function selectPage(pageNo) {
<?php
    $params = $_GET;
    $params[$pagination->pageVar] = 'DUMMY_PAGENO';
?>
    var dummyUrl = "<?php echo $owner->createUrl('', $params); ?>";
    window.location = dummyUrl.replace(/DUMMY_PAGENO/g, pageNo);
}

function gotoPage(pageUrl) {
    if (pageUrl != "") {
        window.location = pageUrl;
    }
}
</script>
<?php
}
?>